< previous page page_186 next page >

Page 186
However, when working with menu options that are specific for a child window, these should be hidden except when the related child window is displayed. Figure 7.13 shows the main menu with no child forms displayed, and Figure 7.14 shows the same menu with the Add child form displayed.
12181-0186a.gif
Figure 7.13.
The starting main menu with no child
form menu options visible.
12181-0186b.gif
Figure 7.14.
When a child form is displayed,
some main options will be grayed out
and others will be made visible.
Go through the menu events and set each of them as needed, remembering to set the Add Entry event to display the Add child form and the Search event to display the Search form. In addition, in each of the child forms, add at least the Close command button to let you close the form and return to the main form. Also, add the code that will set the Enabled property for the menu option back to True. Run the application and see how the menu options work.
Toolbars
Now add the toolbar to the main menu. The first question is which options are going to be available on the toolbar. If you placed every menu option on the toolbar, it would probably take up a good percentage of the work area in the application. Therefore, most applications place only the most used options on the toolbar, enabling the users to add other menu options to the toolbar as they want. This customization is supported by the Toolbar control, so it is easy for you to give it to the user. Your only requirement is to add the initial buttons and the related code to the toolbar click event.

 
< previous page page_186 next page >

If you like this book, buy it!